import { createRouter, createWebHashHistory } from "vue-router";
import ELogConsole from "../components/elog/ELogConsole.vue";
import HelloWorld from "../components/HelloWorld.vue";
import ERoleVisiable from "../components/erole_tree/ERoleVisiable.vue";
import ERecordJsonView from "../components/erole_tree/ERecordJsonView.vue";
import RExec from "../components/rexec/RExec.vue";
import BoxChess from "../components/chess/BoxChess.vue";
import ScriptSearch from "../components/combat_script/ScriptSearch.vue";
import ScriptSearchNew from "../components/combat_script/ScriptSearchNew.vue";
import CombatConfFormatter from "../components/combat_script/CombatConfFormatter.vue";
import Abount from "../components/combat_script/about/Abount.vue";
import TableEditor from "../components/combat_script/otherCfg/TableEditor.vue";
import TalentCfg from "@/components/combat_script/talentCfg/TalentCfg.vue";
import TableVisualable from "../components/table_visualable/TableVisualable.vue";
import XmlChangeVisual from "../components/xml_change_visualable/XmlChangeVisual.vue";
import SystemDocumentation from "../components/SystemDocumentation.vue";
import CombatCalendarSchedule from "../components/calendar/CombatCalendarSchedule.vue";
import AiExecPrint from "../components/ai_exec_print/AiExecPrint.vue";
import CampShow from "../components/camp_show/CampShow.vue";

const routes = [
    {
        path: "/",
        name: "hello",
        component: HelloWorld
    },
    {
        path: "/elog",
        name: "elog",
        component: ELogConsole
    },
    {
        path: "/erole",
        name: "erole",
        component: ERoleVisiable
    },
    {
        path: "/erole/json",
        name: "/erole/json",
        component: ERecordJsonView
    },
    {
        path: "/rexec",
        name: "/rexec",
        component: RExec
    },
    {
        path: "/box_chess",
        name: "/box_chess",
        component: BoxChess
    },
    {
        path: "/script_search",
        name: "/script_search",
        component: ScriptSearch,
        meta: {
          // 缓存页面状态，避免不必要的重新渲染
          keepAlive: true
        }
    },
    {
      path: "/script_search_new",
      name: "/script_search_new",
      component: ScriptSearchNew,
      meta: {
        // 缓存页面状态，避免不必要的重新渲染
        keepAlive: true
      }
  },
    {
        path: "/combat_conf_formatter",
        name: "/combat_conf_formatter",
        component: CombatConfFormatter
    },
    {
        path: "/about",
        name: "/about",
        component: Abount
    },
    {
        path: "/table_editor",
        name: "table_editor",
        component: TableEditor,
        meta: {
            keepAlive: true
        }
    },
    {
      path: "/misc_cfg",
      name: "misc_cfg",
      component: TalentCfg,
      meta: {
          keepAlive: true
      }
  },
  {
    path: "/table_visualable",
    name: "table_visualable",
    component: TableVisualable
  },
  {
    path: "/xml_change_visual",
    name: "xml_change_visual",
    component: XmlChangeVisual
  },
  {
    path: "/system_documentation",
    name: "system_documentation",
    component: SystemDocumentation,
    meta: {
      keepAlive: true
    }
  },
  {
    path: "/calendar_schedule",
    name: "calendar_schedule",
    component: CombatCalendarSchedule,
    meta: {
      keepAlive: true
    }
  },
  {
    path: "/ai_exec_print",
    name: "ai_exec_print",
    component: AiExecPrint,
    meta: {
      keepAlive: true
    }
  },
  {
    path: "/camp_show",
    name: "camp_show",
    component: CampShow,
    meta: {
      keepAlive: true
    }
  }
]

export const router = createRouter({
    history: createWebHashHistory('/skill/'),
    routes
})
